package edu.tju.moralManage;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.younker.waf.db.IBatisConfig;

import edu.tju.classes.AdvisorHistory;

public class IbatisAppraiseDao implements IAppraiseDao{
	protected SqlMapClient sqlMap = IBatisConfig.getSqlMapInstance();


	public List<Appraise> getAppraiseAnd(Appraise appraise) throws SQLException {
		
		return sqlMap.queryForList("getAppraiseAnd", appraise);
	}

	public Appraise getAppraiseById(long id) throws SQLException {
		
		return (Appraise) sqlMap.queryForObject("getAppraiseById", id);
	}

	public List<Appraise> getAppraiseOr(Appraise appraise) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	public Long insertAppraise(Appraise appraise) throws SQLException {
		
		return (Long)sqlMap.insert("insertAppraise", appraise); 
	}

	public int updateAppraise(Appraise appraise) throws SQLException {
		
		return sqlMap.update("updateAppraise", appraise);
	}

	public void deleteAppraise(long id) throws SQLException {
		
		sqlMap.delete("deleteAppraise", id);
	}

}
